package YuanFuDao2;

/**
 * 最长连续递增序列
 */
public class Main3 {
    public static void main(String[] args) {
        int[] nums = {1,3,5,4,7};
        System.out.println(help(nums));
    }

    public static int help(int[] nums){
        if(nums == null || nums.length == 0) return 0;
        int[] dp = new int[nums.length];
        dp[0] = 1;
        int res = 1;
        for (int i = 1; i < nums.length; i++) {
            if(nums[i] > nums[i-1]){
                dp[i] = dp[i-1] + 1;
            }else{
                dp[i] = 1;
            }
            res = Math.max(dp[i],res);
        }
        return res;
    }

}
